﻿namespace IceDog.DNL.CSharp.DesignPattern.AbstractFactoryPattern.WorldThings
{
    /// <summary>
    /// 图形类型
    /// </summary>
    public enum ShapeType
    {
        Circle,
        Rectangle,
        Square
    }

    /// <summary>
    /// 图形工厂
    /// </summary>
    public class ShapeFactory : WorldThingsFactory
    {
        public override IShapeAction GetShape(ShapeType type)
        {
            switch (type)
            {
                case ShapeType.Circle:
                    return new Circle();
                case ShapeType.Square:
                    return new Square();
                case ShapeType.Rectangle:
                    return new Rectangle();
                default:
                    return null;
            }
        }

        public override IColorAction GetColor(ColorType type)
        {
            return null;
        }
    }
}

